A portable electronic device may comprise an ambient light sensor that is used to detect the illuminance of ambient light. The detected illuminance may, for example, be used to set the brightness of a display of the portable electronic device. Thus, if information provided by the ambient light sensor is incorrect or is interpreted incorrectly, the brightness of the display may be incorrectly set.